package cn.bellychang.ood.srp.bad;

import java.util.List;
import java.util.Objects;

/**
 * @author ChangLiang
 * @date 2020/5/12
 */
public class Course {

    private String id;

    /**
     * 描述
     */
    private String desc;

    /**
     * 时长
     */
    private int duration;

    /**
     * this course's pre required courses
     */
    List<Course> prerequisites;

    public List<Course> getPrerequisites() {
        return prerequisites;
    }

    @Override
    public boolean equals(Object obj) {
        if (Objects.isNull(obj) || !(obj instanceof Course)) {
            return false;
        }
        Course course = (Course) obj;
        return Objects.nonNull(course) && course.id.equals(id);
    }
}
